package main

import "fmt"

type Vertex struct {
	X int
	Y int
}

func (v Vertex) Add() int {
	v.X = v.X + 1
	return v.X + v.Y
}

func (v *Vertex) Add2() int {
	v.X = v.X + 1
	return v.X + v.Y
}

func main() {
	v := Vertex{3, 4}
	fmt.Println(v)        //{3 4}
	fmt.Println(v.Add())  //8
	fmt.Println(v)        //{3 4}
	fmt.Println(v.Add2()) //8
	fmt.Println(v)        //{4 4}
}
